<template>
  <div class="wrapper">
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img :src="item.url" class="swiper-img" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: ['swiperList'],
  data() {
    return {
      swiperOptions: {
        pagination: {
          el: '.swiper-pagination',
        },
        loop: true,
        autoplay: true,
      },
    }
  },
}
</script>

<style></style>
<style lang="scss" scoped>
.wrapper ::v-deep .swiper-pagination-bullet-active {
  background: white !important;
}
.swiper-container {
  height: 31.25vw;
}

.wrapper {
  overflow: hidden;
  width: 100%;
  height: 31.25vw;
  margin-bottom: 0.2rem;
  // height: 0;
  // padding-bottom: 31.25%;
  background-color: #f5f5f5;
  .swiper-img {
    width: 100%;
  }
}
</style>
